﻿#region Using directives

using System;
using System.Data;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;

using BesAsm.MasterData.Entities;
using BesAsm.MasterData.Data;

#endregion

namespace BesAsm.MasterData.Data.Bases
{	
	///<summary>
	/// This class is the base class for any <see cref="StreetTargetProviderBase"/> implementation.
	/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
	///</summary>
	public abstract partial class StreetTargetProviderBaseCore : EntityProviderBase<BesAsm.MasterData.Entities.StreetTarget, BesAsm.MasterData.Entities.StreetTargetKey>
	{		
		#region Get from Many To Many Relationship Functions
		#endregion	
		
		#region Delete Methods

		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to delete.</param>
		/// <returns>Returns true if operation suceeded.</returns>
		public override bool Delete(TransactionManager transactionManager, BesAsm.MasterData.Entities.StreetTargetKey key)
		{
			return Delete(transactionManager, key.StreetTargetId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="_streetTargetId">Primary key. Street target ID. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public bool Delete(System.Int32 _streetTargetId)
		{
			return Delete(null, _streetTargetId);
		}
		
		/// <summary>
		/// 	Deletes a row from the DataSource.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_streetTargetId">Primary key. Street target ID. Primary Key.</param>
		/// <remarks>Deletes based on primary key(s).</remarks>
		/// <returns>Returns true if operation suceeded.</returns>
		public abstract bool Delete(TransactionManager transactionManager, System.Int32 _streetTargetId);		
		
		#endregion Delete Methods
		
		#region Get By Foreign Key Functions
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES key.
		///		FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES Description: 
		/// </summary>
		/// <param name="_constructedStatus">0 = Does not meet any of the states below
		/// 		/// 1 = Already constructed, using standard Stormwater Management Manual assumptions for facility volume
		/// 		/// 2 = Already constructed, using design/field data for facility volume
		/// 		/// 3 = To be constructed by 2011, uses Stormwater Management Manual for facility volume
		/// 		/// 4 = To be constructed by 2011, uses design/field data for facility volume</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByConstructedStatus(System.Int32? _constructedStatus)
		{
			int count = -1;
			return GetByConstructedStatus(_constructedStatus, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES key.
		///		FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_constructedStatus">0 = Does not meet any of the states below
		/// 		/// 1 = Already constructed, using standard Stormwater Management Manual assumptions for facility volume
		/// 		/// 2 = Already constructed, using design/field data for facility volume
		/// 		/// 3 = To be constructed by 2011, uses Stormwater Management Manual for facility volume
		/// 		/// 4 = To be constructed by 2011, uses design/field data for facility volume</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		/// <remarks></remarks>
		public TList<StreetTarget> GetByConstructedStatus(TransactionManager transactionManager, System.Int32? _constructedStatus)
		{
			int count = -1;
			return GetByConstructedStatus(transactionManager, _constructedStatus, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES key.
		///		FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_constructedStatus">0 = Does not meet any of the states below
		/// 		/// 1 = Already constructed, using standard Stormwater Management Manual assumptions for facility volume
		/// 		/// 2 = Already constructed, using design/field data for facility volume
		/// 		/// 3 = To be constructed by 2011, uses Stormwater Management Manual for facility volume
		/// 		/// 4 = To be constructed by 2011, uses design/field data for facility volume</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByConstructedStatus(TransactionManager transactionManager, System.Int32? _constructedStatus, int start, int pageLength)
		{
			int count = -1;
			return GetByConstructedStatus(transactionManager, _constructedStatus, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES key.
		///		fkStreetTargetsIcTargetConstructedStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_constructedStatus">0 = Does not meet any of the states below
		/// 		/// 1 = Already constructed, using standard Stormwater Management Manual assumptions for facility volume
		/// 		/// 2 = Already constructed, using design/field data for facility volume
		/// 		/// 3 = To be constructed by 2011, uses Stormwater Management Manual for facility volume
		/// 		/// 4 = To be constructed by 2011, uses design/field data for facility volume</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByConstructedStatus(System.Int32? _constructedStatus, int start, int pageLength)
		{
			int count =  -1;
			return GetByConstructedStatus(null, _constructedStatus, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES key.
		///		fkStreetTargetsIcTargetConstructedStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_constructedStatus">0 = Does not meet any of the states below
		/// 		/// 1 = Already constructed, using standard Stormwater Management Manual assumptions for facility volume
		/// 		/// 2 = Already constructed, using design/field data for facility volume
		/// 		/// 3 = To be constructed by 2011, uses Stormwater Management Manual for facility volume
		/// 		/// 4 = To be constructed by 2011, uses design/field data for facility volume</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByConstructedStatus(System.Int32? _constructedStatus, int start, int pageLength,out int count)
		{
			return GetByConstructedStatus(null, _constructedStatus, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES key.
		///		FK_STREET_TARGETS_IC_TARGET_CONSTRUCTED_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_constructedStatus">0 = Does not meet any of the states below
		/// 		/// 1 = Already constructed, using standard Stormwater Management Manual assumptions for facility volume
		/// 		/// 2 = Already constructed, using design/field data for facility volume
		/// 		/// 3 = To be constructed by 2011, uses Stormwater Management Manual for facility volume
		/// 		/// 4 = To be constructed by 2011, uses design/field data for facility volume</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public abstract TList<StreetTarget> GetByConstructedStatus(TransactionManager transactionManager, System.Int32? _constructedStatus, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_NODES key.
		///		FK_STREET_TARGETS_NODES Description: 
		/// </summary>
		/// <param name="_nodeId">Foreign key to NODES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByNodeId(System.Int32? _nodeId)
		{
			int count = -1;
			return GetByNodeId(_nodeId, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_NODES key.
		///		FK_STREET_TARGETS_NODES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeId">Foreign key to NODES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		/// <remarks></remarks>
		public TList<StreetTarget> GetByNodeId(TransactionManager transactionManager, System.Int32? _nodeId)
		{
			int count = -1;
			return GetByNodeId(transactionManager, _nodeId, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_NODES key.
		///		FK_STREET_TARGETS_NODES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeId">Foreign key to NODES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByNodeId(TransactionManager transactionManager, System.Int32? _nodeId, int start, int pageLength)
		{
			int count = -1;
			return GetByNodeId(transactionManager, _nodeId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_NODES key.
		///		fkStreetTargetsNodes Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_nodeId">Foreign key to NODES</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByNodeId(System.Int32? _nodeId, int start, int pageLength)
		{
			int count =  -1;
			return GetByNodeId(null, _nodeId, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_NODES key.
		///		fkStreetTargetsNodes Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_nodeId">Foreign key to NODES</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByNodeId(System.Int32? _nodeId, int start, int pageLength,out int count)
		{
			return GetByNodeId(null, _nodeId, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_NODES key.
		///		FK_STREET_TARGETS_NODES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_nodeId">Foreign key to NODES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public abstract TList<StreetTarget> GetByNodeId(TransactionManager transactionManager, System.Int32? _nodeId, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_PLACEMENT_TYPES key.
		///		FK_STREET_TARGETS_PLACEMENT_TYPES Description: 
		/// </summary>
		/// <param name="_placementPossibility">Foreign key to PLACEMENT_TYPES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByPlacementPossibility(System.String _placementPossibility)
		{
			int count = -1;
			return GetByPlacementPossibility(_placementPossibility, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_PLACEMENT_TYPES key.
		///		FK_STREET_TARGETS_PLACEMENT_TYPES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_placementPossibility">Foreign key to PLACEMENT_TYPES</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		/// <remarks></remarks>
		public TList<StreetTarget> GetByPlacementPossibility(TransactionManager transactionManager, System.String _placementPossibility)
		{
			int count = -1;
			return GetByPlacementPossibility(transactionManager, _placementPossibility, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_PLACEMENT_TYPES key.
		///		FK_STREET_TARGETS_PLACEMENT_TYPES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_placementPossibility">Foreign key to PLACEMENT_TYPES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByPlacementPossibility(TransactionManager transactionManager, System.String _placementPossibility, int start, int pageLength)
		{
			int count = -1;
			return GetByPlacementPossibility(transactionManager, _placementPossibility, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_PLACEMENT_TYPES key.
		///		fkStreetTargetsPlacementTypes Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_placementPossibility">Foreign key to PLACEMENT_TYPES</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByPlacementPossibility(System.String _placementPossibility, int start, int pageLength)
		{
			int count =  -1;
			return GetByPlacementPossibility(null, _placementPossibility, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_PLACEMENT_TYPES key.
		///		fkStreetTargetsPlacementTypes Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_placementPossibility">Foreign key to PLACEMENT_TYPES</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByPlacementPossibility(System.String _placementPossibility, int start, int pageLength,out int count)
		{
			return GetByPlacementPossibility(null, _placementPossibility, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_PLACEMENT_TYPES key.
		///		FK_STREET_TARGETS_PLACEMENT_TYPES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_placementPossibility">Foreign key to PLACEMENT_TYPES</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public abstract TList<StreetTarget> GetByPlacementPossibility(TransactionManager transactionManager, System.String _placementPossibility, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_SSCS key.
		///		FK_STREET_TARGETS_SSCS Description: 
		/// </summary>
		/// <param name="_sscId">SSC id of subcatchment draining to street control</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetBySscId(System.Int32? _sscId)
		{
			int count = -1;
			return GetBySscId(_sscId, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_SSCS key.
		///		FK_STREET_TARGETS_SSCS Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sscId">SSC id of subcatchment draining to street control</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		/// <remarks></remarks>
		public TList<StreetTarget> GetBySscId(TransactionManager transactionManager, System.Int32? _sscId)
		{
			int count = -1;
			return GetBySscId(transactionManager, _sscId, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_SSCS key.
		///		FK_STREET_TARGETS_SSCS Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sscId">SSC id of subcatchment draining to street control</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetBySscId(TransactionManager transactionManager, System.Int32? _sscId, int start, int pageLength)
		{
			int count = -1;
			return GetBySscId(transactionManager, _sscId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_SSCS key.
		///		fkStreetTargetsSscs Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_sscId">SSC id of subcatchment draining to street control</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetBySscId(System.Int32? _sscId, int start, int pageLength)
		{
			int count =  -1;
			return GetBySscId(null, _sscId, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_SSCS key.
		///		fkStreetTargetsSscs Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_sscId">SSC id of subcatchment draining to street control</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetBySscId(System.Int32? _sscId, int start, int pageLength,out int count)
		{
			return GetBySscId(null, _sscId, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_SSCS key.
		///		FK_STREET_TARGETS_SSCS Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_sscId">SSC id of subcatchment draining to street control</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public abstract TList<StreetTarget> GetBySscId(TransactionManager transactionManager, System.Int32? _sscId, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STATUSES key.
		///		FK_STREET_TARGETS_STATUSES Description: 
		/// </summary>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByStatus(System.String _status)
		{
			int count = -1;
			return GetByStatus(_status, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STATUSES key.
		///		FK_STREET_TARGETS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		/// <remarks></remarks>
		public TList<StreetTarget> GetByStatus(TransactionManager transactionManager, System.String _status)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STATUSES key.
		///		FK_STREET_TARGETS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength)
		{
			int count = -1;
			return GetByStatus(transactionManager, _status, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STATUSES key.
		///		fkStreetTargetsStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByStatus(System.String _status, int start, int pageLength)
		{
			int count =  -1;
			return GetByStatus(null, _status, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STATUSES key.
		///		fkStreetTargetsStatuses Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByStatus(System.String _status, int start, int pageLength,out int count)
		{
			return GetByStatus(null, _status, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STATUSES key.
		///		FK_STREET_TARGETS_STATUSES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_status">Status of record, in terms of usability for further analysis and general state of data</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public abstract TList<StreetTarget> GetByStatus(TransactionManager transactionManager, System.String _status, int start, int pageLength, out int count);
		
	
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STREET_TARGET_TYPES key.
		///		FK_STREET_TARGETS_STREET_TARGET_TYPES Description: 
		/// </summary>
		/// <param name="_controlType">CE = Curb extension
		/// 		/// SP = Sidewalk planter
		/// 		/// VV = Vortex valve
		/// 		/// PP = Pervious pavement</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByControlType(System.String _controlType)
		{
			int count = -1;
			return GetByControlType(_controlType, 0,int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STREET_TARGET_TYPES key.
		///		FK_STREET_TARGETS_STREET_TARGET_TYPES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_controlType">CE = Curb extension
		/// 		/// SP = Sidewalk planter
		/// 		/// VV = Vortex valve
		/// 		/// PP = Pervious pavement</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		/// <remarks></remarks>
		public TList<StreetTarget> GetByControlType(TransactionManager transactionManager, System.String _controlType)
		{
			int count = -1;
			return GetByControlType(transactionManager, _controlType, 0, int.MaxValue, out count);
		}
		
			/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STREET_TARGET_TYPES key.
		///		FK_STREET_TARGETS_STREET_TARGET_TYPES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_controlType">CE = Curb extension
		/// 		/// SP = Sidewalk planter
		/// 		/// VV = Vortex valve
		/// 		/// PP = Pervious pavement</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		///  <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByControlType(TransactionManager transactionManager, System.String _controlType, int start, int pageLength)
		{
			int count = -1;
			return GetByControlType(transactionManager, _controlType, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STREET_TARGET_TYPES key.
		///		fkStreetTargetsStreetTargetTypes Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_controlType">CE = Curb extension
		/// 		/// SP = Sidewalk planter
		/// 		/// VV = Vortex valve
		/// 		/// PP = Pervious pavement</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByControlType(System.String _controlType, int start, int pageLength)
		{
			int count =  -1;
			return GetByControlType(null, _controlType, start, pageLength,out count);	
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STREET_TARGET_TYPES key.
		///		fkStreetTargetsStreetTargetTypes Description: 
		/// </summary>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="_controlType">CE = Curb extension
		/// 		/// SP = Sidewalk planter
		/// 		/// VV = Vortex valve
		/// 		/// PP = Pervious pavement</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public TList<StreetTarget> GetByControlType(System.String _controlType, int start, int pageLength,out int count)
		{
			return GetByControlType(null, _controlType, start, pageLength, out count);	
		}
						
		/// <summary>
		/// 	Gets rows from the datasource based on the FK_STREET_TARGETS_STREET_TARGET_TYPES key.
		///		FK_STREET_TARGETS_STREET_TARGET_TYPES Description: 
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_controlType">CE = Curb extension
		/// 		/// SP = Sidewalk planter
		/// 		/// VV = Vortex valve
		/// 		/// PP = Pervious pavement</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns a typed collection of BesAsm.MasterData.Entities.StreetTarget objects.</returns>
		public abstract TList<StreetTarget> GetByControlType(TransactionManager transactionManager, System.String _controlType, int start, int pageLength, out int count);
		
		#endregion

		#region Get By Index Functions
		
		/// <summary>
		/// 	Gets a row from the DataSource based on its primary key.
		/// </summary>
		/// <param name="transactionManager">A <see cref="TransactionManager"/> object.</param>
		/// <param name="key">The unique identifier of the row to retrieve.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <returns>Returns an instance of the Entity class.</returns>
		public override BesAsm.MasterData.Entities.StreetTarget Get(TransactionManager transactionManager, BesAsm.MasterData.Entities.StreetTargetKey key, int start, int pageLength)
		{
			return GetByStreetTargetId(transactionManager, key.StreetTargetId, start, pageLength);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key PK_STREET_TARGETS index.
		/// </summary>
		/// <param name="_streetTargetId">Primary key. Street target ID</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByStreetTargetId(System.Int32 _streetTargetId)
		{
			int count = -1;
			return GetByStreetTargetId(null,_streetTargetId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_STREET_TARGETS index.
		/// </summary>
		/// <param name="_streetTargetId">Primary key. Street target ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByStreetTargetId(System.Int32 _streetTargetId, int start, int pageLength)
		{
			int count = -1;
			return GetByStreetTargetId(null, _streetTargetId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_STREET_TARGETS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_streetTargetId">Primary key. Street target ID</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByStreetTargetId(TransactionManager transactionManager, System.Int32 _streetTargetId)
		{
			int count = -1;
			return GetByStreetTargetId(transactionManager, _streetTargetId, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_STREET_TARGETS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_streetTargetId">Primary key. Street target ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByStreetTargetId(TransactionManager transactionManager, System.Int32 _streetTargetId, int start, int pageLength)
		{
			int count = -1;
			return GetByStreetTargetId(transactionManager, _streetTargetId, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_STREET_TARGETS index.
		/// </summary>
		/// <param name="_streetTargetId">Primary key. Street target ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByStreetTargetId(System.Int32 _streetTargetId, int start, int pageLength, out int count)
		{
			return GetByStreetTargetId(null, _streetTargetId, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the PK_STREET_TARGETS index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_streetTargetId">Primary key. Street target ID</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.StreetTarget GetByStreetTargetId(TransactionManager transactionManager, System.Int32 _streetTargetId, int start, int pageLength, out int count);
						
		/// <summary>
		/// 	Gets rows from the datasource based on the primary key R137_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByObjectid(System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(null,_objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R137_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByObjectid(System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R137_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, 0, int.MaxValue, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R137_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength)
		{
			int count = -1;
			return GetByObjectid(transactionManager, _objectid, start, pageLength, out count);
		}
		
		/// <summary>
		/// 	Gets rows from the datasource based on the R137_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">out parameter to get total records for query</param>
		/// <remarks></remarks>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public BesAsm.MasterData.Entities.StreetTarget GetByObjectid(System.Int32 _objectid, int start, int pageLength, out int count)
		{
			return GetByObjectid(null, _objectid, start, pageLength, out count);
		}
		
				
		/// <summary>
		/// 	Gets rows from the datasource based on the R137_ROWID_SDE_UK index.
		/// </summary>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="_objectid"></param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="count">The total number of records.</param>
		/// <returns>Returns an instance of the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> class.</returns>
		public abstract BesAsm.MasterData.Entities.StreetTarget GetByObjectid(TransactionManager transactionManager, System.Int32 _objectid, int start, int pageLength, out int count);
						
		#endregion "Get By Index Functions"
	
		#region Custom Methods
		
		
		#region USP_STREET_TARGETS_SELECT_OIDS_BY_NODE_IDS 
		
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByNodeIds(System.Object idTable)
		{
			return SelectOidsByNodeIds(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByNodeIds(int start, int pageLength, System.Object idTable)
		{
			return SelectOidsByNodeIds(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public DataSet SelectOidsByNodeIds(TransactionManager transactionManager, System.Object idTable)
		{
			return SelectOidsByNodeIds(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_OIDS_BY_NODE_IDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="DataSet"/> instance.</returns>
		public abstract DataSet SelectOidsByNodeIds(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#region USP_STREET_TARGETS_SELECT_BY_OIDS 
		
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;StreetTarget&gt;"/> instance.</returns>
		public TList<StreetTarget> SelectByOids(System.Object idTable)
		{
			return SelectByOids(null, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;StreetTarget&gt;"/> instance.</returns>
		public TList<StreetTarget> SelectByOids(int start, int pageLength, System.Object idTable)
		{
			return SelectByOids(null, start, pageLength , idTable);
		}
				
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;StreetTarget&gt;"/> instance.</returns>
		public TList<StreetTarget> SelectByOids(TransactionManager transactionManager, System.Object idTable)
		{
			return SelectByOids(transactionManager, 0, int.MaxValue , idTable);
		}
		
		/// <summary>
		///	This method wrap the 'USP_STREET_TARGETS_SELECT_BY_OIDS' stored procedure. 
		/// </summary>
		/// <param name="idTable"> A <c>System.Object</c> instance.</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">Number of rows to return.</param>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <remark>This method is generate from a stored procedure.</remark>
		/// <returns>A <see cref="TList&lt;StreetTarget&gt;"/> instance.</returns>
		public abstract TList<StreetTarget> SelectByOids(TransactionManager transactionManager, int start, int pageLength , System.Object idTable);
		
		#endregion
		
		#endregion

		#region Helper Functions	
		
		/// <summary>
		/// Fill a TList&lt;StreetTarget&gt; From a DataReader.
		/// </summary>
		/// <param name="reader">Datareader</param>
		/// <param name="rows">The collection to fill</param>
		/// <param name="start">Row number at which to start reading, the first row is 0.</param>
		/// <param name="pageLength">number of rows.</param>
		/// <returns>a <see cref="TList&lt;StreetTarget&gt;"/></returns>
		public static TList<StreetTarget> Fill(IDataReader reader, TList<StreetTarget> rows, int start, int pageLength)
		{
			NetTiersProvider currentProvider = DataRepository.Provider;
            bool useEntityFactory = currentProvider.UseEntityFactory;
            bool enableEntityTracking = currentProvider.EnableEntityTracking;
            LoadPolicy currentLoadPolicy = currentProvider.CurrentLoadPolicy;
			Type entityCreationFactoryType = currentProvider.EntityCreationalFactoryType;
			
			// advance to the starting row
			for (int i = 0; i < start; i++)
			{
				if (!reader.Read())
				return rows; // not enough rows, just return
			}
			for (int i = 0; i < pageLength; i++)
			{
				if (!reader.Read())
					break; // we are done
					
				string key = null;
				
				BesAsm.MasterData.Entities.StreetTarget c = null;
				if (useEntityFactory)
				{
					key = new System.Text.StringBuilder("StreetTarget")
					.Append("|").Append((System.Int32)reader[((int)StreetTargetColumn.StreetTargetId - 1)]).ToString();
					c = EntityManager.LocateOrCreate<StreetTarget>(
					key.ToString(), // EntityTrackingKey
					"StreetTarget",  //Creational Type
					entityCreationFactoryType,  //Factory used to create entity
					enableEntityTracking); // Track this entity?
				}
				else
				{
					c = new BesAsm.MasterData.Entities.StreetTarget();
				}
				
				if (!enableEntityTracking ||
					c.EntityState == EntityState.Added ||
					(enableEntityTracking &&
					
						(
							(currentLoadPolicy == LoadPolicy.PreserveChanges && c.EntityState == EntityState.Unchanged) ||
							(currentLoadPolicy == LoadPolicy.DiscardChanges && c.EntityState != EntityState.Unchanged)
						)
					))
				{
					c.SuppressEntityEvents = true;
					c.Objectid = (System.Int32)reader[((int)StreetTargetColumn.Objectid - 1)];
					c.StreetTargetId = (System.Int32)reader[((int)StreetTargetColumn.StreetTargetId - 1)];
					c.OriginalStreetTargetId = c.StreetTargetId;
					c.ModelAltStreetTargetId = (reader.IsDBNull(((int)StreetTargetColumn.ModelAltStreetTargetId - 1)))?null:(System.String)reader[((int)StreetTargetColumn.ModelAltStreetTargetId - 1)];
					c.NodeId = (reader.IsDBNull(((int)StreetTargetColumn.NodeId - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.NodeId - 1)];
					c.SscId = (reader.IsDBNull(((int)StreetTargetColumn.SscId - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.SscId - 1)];
					c.PlacementPossibility = (reader.IsDBNull(((int)StreetTargetColumn.PlacementPossibility - 1)))?null:(System.String)reader[((int)StreetTargetColumn.PlacementPossibility - 1)];
					c.Comments = (reader.IsDBNull(((int)StreetTargetColumn.Comments - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Comments - 1)];
					c.ControlType = (reader.IsDBNull(((int)StreetTargetColumn.ControlType - 1)))?null:(System.String)reader[((int)StreetTargetColumn.ControlType - 1)];
					c.StreetIa = (reader.IsDBNull(((int)StreetTargetColumn.StreetIa - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.StreetIa - 1)];
					c.MaxReleaseFlow = (reader.IsDBNull(((int)StreetTargetColumn.MaxReleaseFlow - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.MaxReleaseFlow - 1)];
					c.StreetIntersection = (reader.IsDBNull(((int)StreetTargetColumn.StreetIntersection - 1)))?null:(System.String)reader[((int)StreetTargetColumn.StreetIntersection - 1)];
					c.StreetCorner = (reader.IsDBNull(((int)StreetTargetColumn.StreetCorner - 1)))?null:(System.String)reader[((int)StreetTargetColumn.StreetCorner - 1)];
					c.Street1 = (reader.IsDBNull(((int)StreetTargetColumn.Street1 - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Street1 - 1)];
					c.Street1Area = (reader.IsDBNull(((int)StreetTargetColumn.Street1Area - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street1Area - 1)];
					c.Street1CurbExtVolume = (reader.IsDBNull(((int)StreetTargetColumn.Street1CurbExtVolume - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street1CurbExtVolume - 1)];
					c.Street1CurbExtFlow = (reader.IsDBNull(((int)StreetTargetColumn.Street1CurbExtFlow - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.Street1CurbExtFlow - 1)];
					c.Street2 = (reader.IsDBNull(((int)StreetTargetColumn.Street2 - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Street2 - 1)];
					c.Street2Area = (reader.IsDBNull(((int)StreetTargetColumn.Street2Area - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street2Area - 1)];
					c.Street2CurbExtVolume = (reader.IsDBNull(((int)StreetTargetColumn.Street2CurbExtVolume - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street2CurbExtVolume - 1)];
					c.Street2CurbExtFlow = (reader.IsDBNull(((int)StreetTargetColumn.Street2CurbExtFlow - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.Street2CurbExtFlow - 1)];
					c.OrificeIa = (reader.IsDBNull(((int)StreetTargetColumn.OrificeIa - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.OrificeIa - 1)];
					c.CurbExtArea = (reader.IsDBNull(((int)StreetTargetColumn.CurbExtArea - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.CurbExtArea - 1)];
					c.PondingVolume = (reader.IsDBNull(((int)StreetTargetColumn.PondingVolume - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.PondingVolume - 1)];
					c.CurbExtVolume = (reader.IsDBNull(((int)StreetTargetColumn.CurbExtVolume - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.CurbExtVolume - 1)];
					c.Comments2 = (reader.IsDBNull(((int)StreetTargetColumn.Comments2 - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Comments2 - 1)];
					c.TypeCode = (reader.IsDBNull(((int)StreetTargetColumn.TypeCode - 1)))?null:(System.String)reader[((int)StreetTargetColumn.TypeCode - 1)];
					c.XpswmmName = (reader.IsDBNull(((int)StreetTargetColumn.XpswmmName - 1)))?null:(System.String)reader[((int)StreetTargetColumn.XpswmmName - 1)];
					c.XCoord = (reader.IsDBNull(((int)StreetTargetColumn.XCoord - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.XCoord - 1)];
					c.YCoord = (reader.IsDBNull(((int)StreetTargetColumn.YCoord - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.YCoord - 1)];
					c.BuildIcForModel = (reader.IsDBNull(((int)StreetTargetColumn.BuildIcForModel - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.BuildIcForModel - 1)];
					c.Source = (reader.IsDBNull(((int)StreetTargetColumn.Source - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Source - 1)];
					c.AppendDate = (System.DateTime)reader[((int)StreetTargetColumn.AppendDate - 1)];
					c.ConstructedStatus = (reader.IsDBNull(((int)StreetTargetColumn.ConstructedStatus - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.ConstructedStatus - 1)];
					c.EditedBy = (System.String)reader[((int)StreetTargetColumn.EditedBy - 1)];
					c.EditReason = (System.String)reader[((int)StreetTargetColumn.EditReason - 1)];
					c.Status = (System.String)reader[((int)StreetTargetColumn.Status - 1)];
					c.EditDate = (reader.IsDBNull(((int)StreetTargetColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)StreetTargetColumn.EditDate - 1)];
					c.NgtostreetDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.NgtostreetDeprecated - 1)))?null:(System.String)reader[((int)StreetTargetColumn.NgtostreetDeprecated - 1)];
					c.SurfscidDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.SurfscidDeprecated - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.SurfscidDeprecated - 1)];
					c.IcidDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.IcidDeprecated - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.IcidDeprecated - 1)];
					c.SicidDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.SicidDeprecated - 1)))?null:(System.String)reader[((int)StreetTargetColumn.SicidDeprecated - 1)];
					c.Shape = (reader.IsDBNull(((int)StreetTargetColumn.Shape - 1)))?null:(System.Object)reader[((int)StreetTargetColumn.Shape - 1)];
					c.EntityTrackingKey = key;
					c.AcceptChanges();
					c.SuppressEntityEvents = false;
				}
				rows.Add(c);
			}
		return rows;
		}		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> object from the <see cref="IDataReader"/>.
		/// </summary>
		/// <param name="reader">The <see cref="IDataReader"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.StreetTarget"/> object to refresh.</param>
		public static void RefreshEntity(IDataReader reader, BesAsm.MasterData.Entities.StreetTarget entity)
		{
			if (!reader.Read()) return;
			
			entity.Objectid = (System.Int32)reader[((int)StreetTargetColumn.Objectid - 1)];
			entity.StreetTargetId = (System.Int32)reader[((int)StreetTargetColumn.StreetTargetId - 1)];
			entity.OriginalStreetTargetId = (System.Int32)reader["street_target_id"];
			entity.ModelAltStreetTargetId = (reader.IsDBNull(((int)StreetTargetColumn.ModelAltStreetTargetId - 1)))?null:(System.String)reader[((int)StreetTargetColumn.ModelAltStreetTargetId - 1)];
			entity.NodeId = (reader.IsDBNull(((int)StreetTargetColumn.NodeId - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.NodeId - 1)];
			entity.SscId = (reader.IsDBNull(((int)StreetTargetColumn.SscId - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.SscId - 1)];
			entity.PlacementPossibility = (reader.IsDBNull(((int)StreetTargetColumn.PlacementPossibility - 1)))?null:(System.String)reader[((int)StreetTargetColumn.PlacementPossibility - 1)];
			entity.Comments = (reader.IsDBNull(((int)StreetTargetColumn.Comments - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Comments - 1)];
			entity.ControlType = (reader.IsDBNull(((int)StreetTargetColumn.ControlType - 1)))?null:(System.String)reader[((int)StreetTargetColumn.ControlType - 1)];
			entity.StreetIa = (reader.IsDBNull(((int)StreetTargetColumn.StreetIa - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.StreetIa - 1)];
			entity.MaxReleaseFlow = (reader.IsDBNull(((int)StreetTargetColumn.MaxReleaseFlow - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.MaxReleaseFlow - 1)];
			entity.StreetIntersection = (reader.IsDBNull(((int)StreetTargetColumn.StreetIntersection - 1)))?null:(System.String)reader[((int)StreetTargetColumn.StreetIntersection - 1)];
			entity.StreetCorner = (reader.IsDBNull(((int)StreetTargetColumn.StreetCorner - 1)))?null:(System.String)reader[((int)StreetTargetColumn.StreetCorner - 1)];
			entity.Street1 = (reader.IsDBNull(((int)StreetTargetColumn.Street1 - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Street1 - 1)];
			entity.Street1Area = (reader.IsDBNull(((int)StreetTargetColumn.Street1Area - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street1Area - 1)];
			entity.Street1CurbExtVolume = (reader.IsDBNull(((int)StreetTargetColumn.Street1CurbExtVolume - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street1CurbExtVolume - 1)];
			entity.Street1CurbExtFlow = (reader.IsDBNull(((int)StreetTargetColumn.Street1CurbExtFlow - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.Street1CurbExtFlow - 1)];
			entity.Street2 = (reader.IsDBNull(((int)StreetTargetColumn.Street2 - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Street2 - 1)];
			entity.Street2Area = (reader.IsDBNull(((int)StreetTargetColumn.Street2Area - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street2Area - 1)];
			entity.Street2CurbExtVolume = (reader.IsDBNull(((int)StreetTargetColumn.Street2CurbExtVolume - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.Street2CurbExtVolume - 1)];
			entity.Street2CurbExtFlow = (reader.IsDBNull(((int)StreetTargetColumn.Street2CurbExtFlow - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.Street2CurbExtFlow - 1)];
			entity.OrificeIa = (reader.IsDBNull(((int)StreetTargetColumn.OrificeIa - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.OrificeIa - 1)];
			entity.CurbExtArea = (reader.IsDBNull(((int)StreetTargetColumn.CurbExtArea - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.CurbExtArea - 1)];
			entity.PondingVolume = (reader.IsDBNull(((int)StreetTargetColumn.PondingVolume - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.PondingVolume - 1)];
			entity.CurbExtVolume = (reader.IsDBNull(((int)StreetTargetColumn.CurbExtVolume - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.CurbExtVolume - 1)];
			entity.Comments2 = (reader.IsDBNull(((int)StreetTargetColumn.Comments2 - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Comments2 - 1)];
			entity.TypeCode = (reader.IsDBNull(((int)StreetTargetColumn.TypeCode - 1)))?null:(System.String)reader[((int)StreetTargetColumn.TypeCode - 1)];
			entity.XpswmmName = (reader.IsDBNull(((int)StreetTargetColumn.XpswmmName - 1)))?null:(System.String)reader[((int)StreetTargetColumn.XpswmmName - 1)];
			entity.XCoord = (reader.IsDBNull(((int)StreetTargetColumn.XCoord - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.XCoord - 1)];
			entity.YCoord = (reader.IsDBNull(((int)StreetTargetColumn.YCoord - 1)))?null:(System.Decimal?)reader[((int)StreetTargetColumn.YCoord - 1)];
			entity.BuildIcForModel = (reader.IsDBNull(((int)StreetTargetColumn.BuildIcForModel - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.BuildIcForModel - 1)];
			entity.Source = (reader.IsDBNull(((int)StreetTargetColumn.Source - 1)))?null:(System.String)reader[((int)StreetTargetColumn.Source - 1)];
			entity.AppendDate = (System.DateTime)reader[((int)StreetTargetColumn.AppendDate - 1)];
			entity.ConstructedStatus = (reader.IsDBNull(((int)StreetTargetColumn.ConstructedStatus - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.ConstructedStatus - 1)];
			entity.EditedBy = (System.String)reader[((int)StreetTargetColumn.EditedBy - 1)];
			entity.EditReason = (System.String)reader[((int)StreetTargetColumn.EditReason - 1)];
			entity.Status = (System.String)reader[((int)StreetTargetColumn.Status - 1)];
			entity.EditDate = (reader.IsDBNull(((int)StreetTargetColumn.EditDate - 1)))?null:(System.DateTime?)reader[((int)StreetTargetColumn.EditDate - 1)];
			entity.NgtostreetDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.NgtostreetDeprecated - 1)))?null:(System.String)reader[((int)StreetTargetColumn.NgtostreetDeprecated - 1)];
			entity.SurfscidDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.SurfscidDeprecated - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.SurfscidDeprecated - 1)];
			entity.IcidDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.IcidDeprecated - 1)))?null:(System.Int32?)reader[((int)StreetTargetColumn.IcidDeprecated - 1)];
			entity.SicidDeprecated = (reader.IsDBNull(((int)StreetTargetColumn.SicidDeprecated - 1)))?null:(System.String)reader[((int)StreetTargetColumn.SicidDeprecated - 1)];
			entity.Shape = (reader.IsDBNull(((int)StreetTargetColumn.Shape - 1)))?null:(System.Object)reader[((int)StreetTargetColumn.Shape - 1)];
			entity.AcceptChanges();
		}
		
		/// <summary>
		/// Refreshes the <see cref="BesAsm.MasterData.Entities.StreetTarget"/> object from the <see cref="DataSet"/>.
		/// </summary>
		/// <param name="dataSet">The <see cref="DataSet"/> to read from.</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.StreetTarget"/> object.</param>
		public static void RefreshEntity(DataSet dataSet, BesAsm.MasterData.Entities.StreetTarget entity)
		{
			DataRow dataRow = dataSet.Tables[0].Rows[0];
			
			entity.Objectid = (System.Int32)dataRow["OBJECTID"];
			entity.StreetTargetId = (System.Int32)dataRow["street_target_id"];
			entity.OriginalStreetTargetId = (System.Int32)dataRow["street_target_id"];
			entity.ModelAltStreetTargetId = Convert.IsDBNull(dataRow["model_alt_street_target_id"]) ? null : (System.String)dataRow["model_alt_street_target_id"];
			entity.NodeId = Convert.IsDBNull(dataRow["node_id"]) ? null : (System.Int32?)dataRow["node_id"];
			entity.SscId = Convert.IsDBNull(dataRow["ssc_id"]) ? null : (System.Int32?)dataRow["ssc_id"];
			entity.PlacementPossibility = Convert.IsDBNull(dataRow["placement_possibility"]) ? null : (System.String)dataRow["placement_possibility"];
			entity.Comments = Convert.IsDBNull(dataRow["comments"]) ? null : (System.String)dataRow["comments"];
			entity.ControlType = Convert.IsDBNull(dataRow["control_type"]) ? null : (System.String)dataRow["control_type"];
			entity.StreetIa = Convert.IsDBNull(dataRow["street_ia"]) ? null : (System.Decimal?)dataRow["street_ia"];
			entity.MaxReleaseFlow = Convert.IsDBNull(dataRow["max_release_flow"]) ? null : (System.Decimal?)dataRow["max_release_flow"];
			entity.StreetIntersection = Convert.IsDBNull(dataRow["street_intersection"]) ? null : (System.String)dataRow["street_intersection"];
			entity.StreetCorner = Convert.IsDBNull(dataRow["street_corner"]) ? null : (System.String)dataRow["street_corner"];
			entity.Street1 = Convert.IsDBNull(dataRow["street_1"]) ? null : (System.String)dataRow["street_1"];
			entity.Street1Area = Convert.IsDBNull(dataRow["street_1_area"]) ? null : (System.Int32?)dataRow["street_1_area"];
			entity.Street1CurbExtVolume = Convert.IsDBNull(dataRow["street_1_curb_ext_volume"]) ? null : (System.Int32?)dataRow["street_1_curb_ext_volume"];
			entity.Street1CurbExtFlow = Convert.IsDBNull(dataRow["street_1_curb_ext_flow"]) ? null : (System.Decimal?)dataRow["street_1_curb_ext_flow"];
			entity.Street2 = Convert.IsDBNull(dataRow["street_2"]) ? null : (System.String)dataRow["street_2"];
			entity.Street2Area = Convert.IsDBNull(dataRow["street_2_area"]) ? null : (System.Int32?)dataRow["street_2_area"];
			entity.Street2CurbExtVolume = Convert.IsDBNull(dataRow["street_2_curb_ext_volume"]) ? null : (System.Int32?)dataRow["street_2_curb_ext_volume"];
			entity.Street2CurbExtFlow = Convert.IsDBNull(dataRow["street_2_curb_ext_flow"]) ? null : (System.Decimal?)dataRow["street_2_curb_ext_flow"];
			entity.OrificeIa = Convert.IsDBNull(dataRow["orifice_ia"]) ? null : (System.Decimal?)dataRow["orifice_ia"];
			entity.CurbExtArea = Convert.IsDBNull(dataRow["curb_ext_area"]) ? null : (System.Int32?)dataRow["curb_ext_area"];
			entity.PondingVolume = Convert.IsDBNull(dataRow["ponding_volume"]) ? null : (System.Decimal?)dataRow["ponding_volume"];
			entity.CurbExtVolume = Convert.IsDBNull(dataRow["curb_ext_volume"]) ? null : (System.Decimal?)dataRow["curb_ext_volume"];
			entity.Comments2 = Convert.IsDBNull(dataRow["comments_2"]) ? null : (System.String)dataRow["comments_2"];
			entity.TypeCode = Convert.IsDBNull(dataRow["type_code"]) ? null : (System.String)dataRow["type_code"];
			entity.XpswmmName = Convert.IsDBNull(dataRow["xpswmm_name"]) ? null : (System.String)dataRow["xpswmm_name"];
			entity.XCoord = Convert.IsDBNull(dataRow["x_coord"]) ? null : (System.Decimal?)dataRow["x_coord"];
			entity.YCoord = Convert.IsDBNull(dataRow["y_coord"]) ? null : (System.Decimal?)dataRow["y_coord"];
			entity.BuildIcForModel = Convert.IsDBNull(dataRow["build_ic_for_model"]) ? null : (System.Int32?)dataRow["build_ic_for_model"];
			entity.Source = Convert.IsDBNull(dataRow["source"]) ? null : (System.String)dataRow["source"];
			entity.AppendDate = (System.DateTime)dataRow["append_date"];
			entity.ConstructedStatus = Convert.IsDBNull(dataRow["constructed_status"]) ? null : (System.Int32?)dataRow["constructed_status"];
			entity.EditedBy = (System.String)dataRow["edited_by"];
			entity.EditReason = (System.String)dataRow["edit_reason"];
			entity.Status = (System.String)dataRow["status"];
			entity.EditDate = Convert.IsDBNull(dataRow["edit_date"]) ? null : (System.DateTime?)dataRow["edit_date"];
			entity.NgtostreetDeprecated = Convert.IsDBNull(dataRow["ngtostreet_deprecated"]) ? null : (System.String)dataRow["ngtostreet_deprecated"];
			entity.SurfscidDeprecated = Convert.IsDBNull(dataRow["surfscid_deprecated"]) ? null : (System.Int32?)dataRow["surfscid_deprecated"];
			entity.IcidDeprecated = Convert.IsDBNull(dataRow["icid_deprecated"]) ? null : (System.Int32?)dataRow["icid_deprecated"];
			entity.SicidDeprecated = Convert.IsDBNull(dataRow["sicid_deprecated"]) ? null : (System.String)dataRow["sicid_deprecated"];
			entity.Shape = Convert.IsDBNull(dataRow["SHAPE"]) ? null : (System.Object)dataRow["SHAPE"];
			entity.AcceptChanges();
		}
		#endregion 
		
		#region DeepLoad Methods
		/// <summary>
		/// Deep Loads the <see cref="IEntity"/> object with criteria based of the child 
		/// property collections only N Levels Deep based on the <see cref="DeepLoadType"/>.
		/// </summary>
		/// <remarks>
		/// Use this method with caution as it is possible to DeepLoad with Recursion and traverse an entire object graph.
		/// </remarks>
		/// <param name="transactionManager"><see cref="TransactionManager"/> object</param>
		/// <param name="entity">The <see cref="BesAsm.MasterData.Entities.StreetTarget"/> object to load.</param>
		/// <param name="deep">Boolean. A flag that indicates whether to recursively save all Property Collection that are descendants of this instance. If True, saves the complete object graph below this object. If False, saves this object only. </param>
		/// <param name="deepLoadType">DeepLoadType Enumeration to Include/Exclude object property collections from Load.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.StreetTarget Property Collection Type Array To Include or Exclude from Load</param>
		/// <param name="innerList">A collection of child types for easy access.</param>
	    /// <exception cref="ArgumentNullException">entity or childTypes is null.</exception>
	    /// <exception cref="ArgumentException">deepLoadType has invalid value.</exception>
		public override void DeepLoad(TransactionManager transactionManager, BesAsm.MasterData.Entities.StreetTarget entity, bool deep, DeepLoadType deepLoadType, System.Type[] childTypes, DeepSession innerList)
		{
			if(entity == null)
				return;

			#region ConstructedStatusSource	
			if (CanDeepLoad(entity, "IcTargetConstructedStatus|ConstructedStatusSource", deepLoadType, innerList) 
				&& entity.ConstructedStatusSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.ConstructedStatus ?? (int)0);
				IcTargetConstructedStatus tmpEntity = EntityManager.LocateEntity<IcTargetConstructedStatus>(EntityLocator.ConstructKeyFromPkItems(typeof(IcTargetConstructedStatus), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ConstructedStatusSource = tmpEntity;
				else
					entity.ConstructedStatusSource = DataRepository.IcTargetConstructedStatusProvider.GetByIcTargetConstructedStatusId(transactionManager, (entity.ConstructedStatus ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ConstructedStatusSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ConstructedStatusSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.IcTargetConstructedStatusProvider.DeepLoad(transactionManager, entity.ConstructedStatusSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ConstructedStatusSource

			#region NodeIdSource	
			if (CanDeepLoad(entity, "Node|NodeIdSource", deepLoadType, innerList) 
				&& entity.NodeIdSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.NodeId ?? (int)0);
				Node tmpEntity = EntityManager.LocateEntity<Node>(EntityLocator.ConstructKeyFromPkItems(typeof(Node), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.NodeIdSource = tmpEntity;
				else
					entity.NodeIdSource = DataRepository.NodeProvider.GetByNodeId(transactionManager, (entity.NodeId ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'NodeIdSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.NodeIdSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.NodeProvider.DeepLoad(transactionManager, entity.NodeIdSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion NodeIdSource

			#region PlacementPossibilitySource	
			if (CanDeepLoad(entity, "PlacementType|PlacementPossibilitySource", deepLoadType, innerList) 
				&& entity.PlacementPossibilitySource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.PlacementPossibility ?? string.Empty);
				PlacementType tmpEntity = EntityManager.LocateEntity<PlacementType>(EntityLocator.ConstructKeyFromPkItems(typeof(PlacementType), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.PlacementPossibilitySource = tmpEntity;
				else
					entity.PlacementPossibilitySource = DataRepository.PlacementTypeProvider.GetByPlacementTypeId(transactionManager, (entity.PlacementPossibility ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'PlacementPossibilitySource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.PlacementPossibilitySource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.PlacementTypeProvider.DeepLoad(transactionManager, entity.PlacementPossibilitySource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion PlacementPossibilitySource

			#region SscIdSource	
			if (CanDeepLoad(entity, "Ssc|SscIdSource", deepLoadType, innerList) 
				&& entity.SscIdSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.SscId ?? (int)0);
				Ssc tmpEntity = EntityManager.LocateEntity<Ssc>(EntityLocator.ConstructKeyFromPkItems(typeof(Ssc), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.SscIdSource = tmpEntity;
				else
					entity.SscIdSource = DataRepository.SscProvider.GetBySscId(transactionManager, (entity.SscId ?? (int)0));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'SscIdSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.SscIdSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.SscProvider.DeepLoad(transactionManager, entity.SscIdSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion SscIdSource

			#region StatusSource	
			if (CanDeepLoad(entity, "Status|StatusSource", deepLoadType, innerList) 
				&& entity.StatusSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = entity.Status;
				Status tmpEntity = EntityManager.LocateEntity<Status>(EntityLocator.ConstructKeyFromPkItems(typeof(Status), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.StatusSource = tmpEntity;
				else
					entity.StatusSource = DataRepository.StatusProvider.GetByStatusId(transactionManager, entity.Status);		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'StatusSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.StatusSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.StatusProvider.DeepLoad(transactionManager, entity.StatusSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion StatusSource

			#region ControlTypeSource	
			if (CanDeepLoad(entity, "StreetTargetType|ControlTypeSource", deepLoadType, innerList) 
				&& entity.ControlTypeSource == null)
			{
				object[] pkItems = new object[1];
				pkItems[0] = (entity.ControlType ?? string.Empty);
				StreetTargetType tmpEntity = EntityManager.LocateEntity<StreetTargetType>(EntityLocator.ConstructKeyFromPkItems(typeof(StreetTargetType), pkItems), DataRepository.Provider.EnableEntityTracking);
				if (tmpEntity != null)
					entity.ControlTypeSource = tmpEntity;
				else
					entity.ControlTypeSource = DataRepository.StreetTargetTypeProvider.GetByStreetTargetTypeId(transactionManager, (entity.ControlType ?? string.Empty));		
				
				#if NETTIERS_DEBUG
				System.Diagnostics.Debug.WriteLine("- property 'ControlTypeSource' loaded. key " + entity.EntityTrackingKey);
				#endif 
				
				if (deep && entity.ControlTypeSource != null)
				{
					innerList.SkipChildren = true;
					DataRepository.StreetTargetTypeProvider.DeepLoad(transactionManager, entity.ControlTypeSource, deep, deepLoadType, childTypes, innerList);
					innerList.SkipChildren = false;
				}
					
			}
			#endregion ControlTypeSource
			
			//used to hold DeepLoad method delegates and fire after all the local children have been loaded.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			
			//Fire all DeepLoad Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			deepHandles = null;
		}
		
		#endregion 
		
		#region DeepSave Methods

		/// <summary>
		/// Deep Save the entire object graph of the BesAsm.MasterData.Entities.StreetTarget object with criteria based of the child 
		/// Type property array and DeepSaveType.
		/// </summary>
		/// <param name="transactionManager">The transaction manager.</param>
		/// <param name="entity">BesAsm.MasterData.Entities.StreetTarget instance</param>
		/// <param name="deepSaveType">DeepSaveType Enumeration to Include/Exclude object property collections from Save.</param>
		/// <param name="childTypes">BesAsm.MasterData.Entities.StreetTarget Property Collection Type Array To Include or Exclude from Save</param>
		/// <param name="innerList">A Hashtable of child types for easy access.</param>
		public override bool DeepSave(TransactionManager transactionManager, BesAsm.MasterData.Entities.StreetTarget entity, DeepSaveType deepSaveType, System.Type[] childTypes, DeepSession innerList)
		{	
			if (entity == null)
				return false;
							
			#region Composite Parent Properties
			//Save Source Composite Properties, however, don't call deep save on them.  
			//So they only get saved a single level deep.
			
			#region ConstructedStatusSource
			if (CanDeepSave(entity, "IcTargetConstructedStatus|ConstructedStatusSource", deepSaveType, innerList) 
				&& entity.ConstructedStatusSource != null)
			{
				DataRepository.IcTargetConstructedStatusProvider.Save(transactionManager, entity.ConstructedStatusSource);
				entity.ConstructedStatus = entity.ConstructedStatusSource.IcTargetConstructedStatusId;
			}
			#endregion 
			
			#region NodeIdSource
			if (CanDeepSave(entity, "Node|NodeIdSource", deepSaveType, innerList) 
				&& entity.NodeIdSource != null)
			{
				DataRepository.NodeProvider.Save(transactionManager, entity.NodeIdSource);
				entity.NodeId = entity.NodeIdSource.NodeId;
			}
			#endregion 
			
			#region PlacementPossibilitySource
			if (CanDeepSave(entity, "PlacementType|PlacementPossibilitySource", deepSaveType, innerList) 
				&& entity.PlacementPossibilitySource != null)
			{
				DataRepository.PlacementTypeProvider.Save(transactionManager, entity.PlacementPossibilitySource);
				entity.PlacementPossibility = entity.PlacementPossibilitySource.PlacementTypeId;
			}
			#endregion 
			
			#region SscIdSource
			if (CanDeepSave(entity, "Ssc|SscIdSource", deepSaveType, innerList) 
				&& entity.SscIdSource != null)
			{
				DataRepository.SscProvider.Save(transactionManager, entity.SscIdSource);
				entity.SscId = entity.SscIdSource.SscId;
			}
			#endregion 
			
			#region StatusSource
			if (CanDeepSave(entity, "Status|StatusSource", deepSaveType, innerList) 
				&& entity.StatusSource != null)
			{
				DataRepository.StatusProvider.Save(transactionManager, entity.StatusSource);
				entity.Status = entity.StatusSource.StatusId;
			}
			#endregion 
			
			#region ControlTypeSource
			if (CanDeepSave(entity, "StreetTargetType|ControlTypeSource", deepSaveType, innerList) 
				&& entity.ControlTypeSource != null)
			{
				DataRepository.StreetTargetTypeProvider.Save(transactionManager, entity.ControlTypeSource);
				entity.ControlType = entity.ControlTypeSource.StreetTargetTypeId;
			}
			#endregion 
			#endregion Composite Parent Properties

			// Save Root Entity through Provider
			if (!entity.IsDeleted)
				this.Save(transactionManager, entity);
			
			//used to hold DeepSave method delegates and fire after all the local children have been saved.
			Dictionary<string, KeyValuePair<Delegate, object>> deepHandles = new Dictionary<string, KeyValuePair<Delegate, object>>();
			//Fire all DeepSave Items
			foreach(KeyValuePair<Delegate, object> pair in deepHandles.Values)
		    {
                pair.Key.DynamicInvoke((object[])pair.Value);
		    }
			
			// Save Root Entity through Provider, if not already saved in delete mode
			if (entity.IsDeleted)
				this.Save(transactionManager, entity);
				

			deepHandles = null;
						
			return true;
		}
		#endregion
	} // end class
	
	#region StreetTargetChildEntityTypes
	
	///<summary>
	/// Enumeration used to expose the different child entity types 
	/// for child properties in <c>BesAsm.MasterData.Entities.StreetTarget</c>
	///</summary>
	public enum StreetTargetChildEntityTypes
	{
		
		///<summary>
		/// Composite Property for <c>IcTargetConstructedStatus</c> at ConstructedStatusSource
		///</summary>
		[ChildEntityType(typeof(IcTargetConstructedStatus))]
		IcTargetConstructedStatus,
			
		///<summary>
		/// Composite Property for <c>Node</c> at NodeIdSource
		///</summary>
		[ChildEntityType(typeof(Node))]
		Node,
			
		///<summary>
		/// Composite Property for <c>PlacementType</c> at PlacementPossibilitySource
		///</summary>
		[ChildEntityType(typeof(PlacementType))]
		PlacementType,
			
		///<summary>
		/// Composite Property for <c>Ssc</c> at SscIdSource
		///</summary>
		[ChildEntityType(typeof(Ssc))]
		Ssc,
			
		///<summary>
		/// Composite Property for <c>Status</c> at StatusSource
		///</summary>
		[ChildEntityType(typeof(Status))]
		Status,
			
		///<summary>
		/// Composite Property for <c>StreetTargetType</c> at ControlTypeSource
		///</summary>
		[ChildEntityType(typeof(StreetTargetType))]
		StreetTargetType,
		}
	
	#endregion StreetTargetChildEntityTypes
	
	#region StreetTargetFilterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;StreetTargetColumn&gt;"/> class
	/// that is used exclusively with a <see cref="StreetTarget"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class StreetTargetFilterBuilder : SqlFilterBuilder<StreetTargetColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the StreetTargetFilterBuilder class.
		/// </summary>
		public StreetTargetFilterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the StreetTargetFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public StreetTargetFilterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the StreetTargetFilterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public StreetTargetFilterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion StreetTargetFilterBuilder
	
	#region StreetTargetParameterBuilder
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ParameterizedSqlFilterBuilder&lt;StreetTargetColumn&gt;"/> class
	/// that is used exclusively with a <see cref="StreetTarget"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class StreetTargetParameterBuilder : ParameterizedSqlFilterBuilder<StreetTargetColumn>
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the StreetTargetParameterBuilder class.
		/// </summary>
		public StreetTargetParameterBuilder() : base() { }

		/// <summary>
		/// Initializes a new instance of the StreetTargetParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public StreetTargetParameterBuilder(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the StreetTargetParameterBuilder class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public StreetTargetParameterBuilder(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion StreetTargetParameterBuilder
	
	#region StreetTargetSortBuilder
    
    /// <summary>
    /// A strongly-typed instance of the <see cref="SqlSortBuilder&lt;StreetTargetColumn&gt;"/> class
	/// that is used exclusively with a <see cref="StreetTarget"/> object.
    /// </summary>
    [CLSCompliant(true)]
    public class StreetTargetSortBuilder : SqlSortBuilder<StreetTargetColumn>
    {
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the StreetTargetSqlSortBuilder class.
		/// </summary>
		public StreetTargetSortBuilder() : base() { }

		#endregion Constructors

    }    
    #endregion StreetTargetSortBuilder
	
} // end namespace
